package com.yzh.croom.service.impl;

import com.yzh.croom.mapper.MessageMapper;
import com.yzh.croom.model.domain.Message;
import com.yzh.croom.repository.MessageRepository;
import com.yzh.croom.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private MessageRepository messageRepository;
    @Autowired
    private MessageMapper messageMapper;
    @Override
    public List<Message> getUnReadMessage() {
        return messageRepository.getUnReadMessage();
    }

    @Override
    public int updateById(int id) {
        return messageMapper.updateById(id);
    }

    @Override
    public List<Message> getIsReadMessage() {
        return messageRepository.getIsReadMessage();
    }

    @Override
    public int deleteMessageByIds(String[] ids) {
        return messageMapper.deleteMessageByIds(ids);
    }

    @Override
    public List<Message> getMessageByAccountAndStatus(String account, int status) {
        return messageRepository.getMessageByAccountAndStatus(account,status);
    }

    @Override
    public int insertMsg(Message message) {
        return messageMapper.insertMsg(message);
    }
}
